<template>
  <div class="job-main">
        <div class="main-left">
            <div class="main-left-search">
                <input class="main-left-search-input" placeholder="搜索职位、公司" v-model="this.search"/>
                <div class="main-left-search-btn">
                    搜索
                </div>
            </div>

            <div class="main-context-block">
                <div v-for="(item,index) in items" :key="index" class="main-context">
                    <div class="main-context-left">
                        <div class="main-context-header">
                            <div class="main-context-title">
                                {{item.title}}
                            </div>
                            <div class="main-context-money">
                                {{item.money}}K
                            </div>
                        </div>
                        
                        <div class="main-context-second">
                            <div class="main-context-want">
                                {{item.want}}
                            </div>
                        </div>

                        <div class="main-context-bottom">
                            <div class="main-context-enterprise-header">

                            </div>
                            <div class="main-context-enterprise">
                                {{item.enterprise_name}}
                            </div>
                            <div class="main-context-enterprise-scale">
                                {{item.scale}}人或以上
                            </div>
                        </div>
                    </div>
                    <div class="main-context-right">
                        <div class="main-context-right-header">

                        </div>
                        <div class="main-context-right-position">
                            {{item.sku_name}}·{{item.name}}
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="main-right">
            <div class="main-right-header">
                <div class="main-right-user">
                    <div class="main-right-user-header">
                    </div>
                    <div class="main-right-user-detail">
                        <div class="main-right-user-detail-username">
                            管理员
                        </div>
                        <div class="main-right-user-detail-sign">

                        </div>
                    </div>
                </div>
                <div class="main-right-operator">
                    <div class="main-right-operator-curriculum-vitae">
                        在线简历
                    </div>
                    <div class="main-right-operator-curriculum-vitae">
                        校招社招
                    </div>
                    <div class="main-right-operator-curriculum-vitae">
                        在线简历
                    </div>
                </div>
            </div>
            <div class="main-right-main">
                <div class="main-right-main-top">
                    <div class="main-right-main-top-block" @click="this.$router.push('/submitJob')">
                        我要招聘
                    </div>
                    <div class="main-right-main-top-block">
                        绑定企业
                    </div>
                    <div class="main-right-main-top-block">
                        解绑企业
                    </div>
                </div>
            </div>
        </div>
  </div>
</template>

<script>
import request from '@/utils/request.js';
import setHeader from '@/api/tools/setHeaders.js'

export default {
    data(){
        return{
            items: [
            ],
            search: ''
        }
    },
    methods:{
        getList(){
            let headers = setHeader();
            request.get("/api/job/jobList?search="+this.search,{headers:headers}).then(res=>{
                this.items = res.data
                console.log(res)
            })
        }
    },
    mounted() {
        this.getList();
    },
}
</script>

<style lang="scss" scoped>
.job-main{
    padding-top: 40px;
    display: flex;
    justify-content: center;
    .main-left{
        height: 100px;
        width: 800px;
        .main-left-search{
            background-color: #FFF;
            width: 100%;
            height: 50px;
            border-radius: 5px;
            box-shadow: 0px 0px 30px rgb(231, 231, 231);
            display: flex;
            align-items: center;
            .main-left-search-input{
                margin-left: 20px;
                height: 40px;
                width: 680px;
                border: none;
                outline: none;
            }
            .main-left-search-input::placeholder{
                color: #9e9e9e;
            }
            .main-left-search-btn{
                width: 80px;
                height: 40px;
                background-color: rgb(0, 162, 255);
                border-radius: 5px;
                margin-left: 10px;
                display: flex;
                align-items: center;
                justify-content: center;
                color: #FFF;
                font-size: 18px;
                cursor: pointer;
                transition: background-color 0.2s ease;
            }
            .main-left-search-btn:hover{
                background-color: rgb(255, 102, 0);
                transition: background-color 0.2s ease;
            }
        }
        .main-context-block{
            margin-top: 40px;
            .main-context{
                border-radius: 5px;
                background-color: #FFF;
                margin-top: 10px;
                height: 150px;
                display: flex;
                .main-context-left{
                    width: 80%;
                    .main-context-header{
                        display: flex;
                        .main-context-title{
                            padding-left: 40px;
                            padding-top: 20px;
                            font-size: 20px;
                            font-weight: 900;
                            color: #444444;
                            cursor: pointer;
                            transition: color 0.2s ease-in-out;
                        }
                        .main-context-title:hover{
                            color: #028dff;
                            transition: color 0.2s ease-in-out;
                        }
                        .main-context-money{
                            padding-left: 20px;
                            padding-top: 22px;
                            font-size: 18px;
                            font-weight: 900;
                            color: #028dff;
                        }
                    }
                    .main-context-second{
                        padding-left: 40px;
                        padding-top: 10px;
                        .main-context-want{
                            color: #535353;
                            font-size: 14px;
                            background-color: #f7f7f7;
                            width: 60px;
                            display: flex;
                            align-items: center;
                            justify-content: center;
                            border-radius: 5px;
                            padding: 5px;
                        }
                    }
                    .main-context-bottom{
                        padding-top: 20px;
                        padding-left: 40px;
                        display: flex;
                        align-items: center;
                        .main-context-enterprise-header{
                            background-color: #028dff;
                            width: 20px;
                            height: 20px;
                            border-radius: 20px;
                        }
                        .main-context-enterprise{
                            padding-left: 5px;
                            font-size: 14px;
                        }
                        .main-context-enterprise-scale{
                            color: #8f8f8f;
                            font-size: 14px;
                            padding-left: 20px;
                        }
                    }
                }
                .main-context-right{
                    padding-top: 40px;
                    .main-context-right-header{
                        background-color: #028dff;
                        width: 40px;
                        height: 40px;
                        border-radius: 20px;
                        margin-left: 40px;
                    }
                    .main-context-right-position{
                        font-size: 16px;
                        padding-top: 10px;
                        display: flex;
                        align-items: center;
                        justify-content: center;
                        width: 120px;
                    }
                }
            }
        }
    }
    .main-right{
        margin-left: 20px;
        min-height: 100px;
        width: 400px;
        .main-right-user-header{
            background-color: #028dff;
            width: 80px;
            height: 80px;
            border-radius: 100px;
        }
        .main-right-header{
            background-color: #FFF;
            border-radius: 5px;
            padding-left: 20px;
            padding-top: 20px;
            padding-bottom: 20px;
            .main-right-user{
                display: flex;
                .main-right-user-detail{
                    .main-right-user-detail-username{
                        font-size: 22px;
                        font-weight: 900;
                        padding-top: 15px;
                        padding-left: 10px;
                        color: #505050;
                        cursor: pointer;
                        transition: color 0.2s ease-out;
                    }
                    .main-right-user-detail-username:hover{
                        color: #028dff;
                        transition: color 0.2s ease-out;
                    }
                }
            }
            .main-right-operator{
                padding-top: 20px;
                display: flex;
                .main-right-operator-curriculum-vitae{
                    background-color: #e9e9e9;
                    width: 100px;
                    display: flex;
                    align-items: center;
                    justify-content: center;
                    color: #616161;
                    font-size: 18px;
                    font-weight: 900;
                    border-radius: 15px;
                    height: 40px;
                    cursor: pointer;
                    margin-right: 20px;
                    transition: background-color 0.2s ease-out,
                                border-radius 0.2s ease-out;
                }
                .main-right-operator-curriculum-vitae:hover{
                    background-color: rgb(255, 102, 0);
                    border-radius: 5px;
                    color: #FFF;
                    transition: background-color 0.2s ease-out,
                                border-radius 0.2s ease-out;
                }
            }
        }
        .main-right-main{
            background-color: #FFF;
            // min-height: 200px;
            margin-top: 20px;
            border-radius: 10px;
            .main-right-main-top{
                // padding-top: 20px;
                min-height: 50px;
                .main-right-main-top-block{
                    transition: background-color 0.2s ease;
                    cursor: pointer;
                    min-height: 50px;
                    width: 100%;
                    display: flex;
                    justify-content: center;
                    align-items: center;
                    border-bottom: 2px solid rgb(240, 242, 245);
                    font-size: 18px;
                    font-weight: 900;
                    color: rgb(87, 87, 87);
                }
                .main-right-main-top-block:hover{
                    background-color: rgb(0, 162, 255);
                    transition: background-color 0.2s ease;
                    color: white;
                }
            }
        }
    }
}
</style>